﻿<UserControl x:Class="Starehe.Views.SetFeesStructure"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      xmlns:Controls="clr-namespace:Helper.Controls;assembly=Helper"
      d:DesignHeight="600" d:DesignWidth="900"
             Background="White"
	>
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Starehe;component/ModelsDataTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <TextBlock HorizontalAlignment="Left" Margin="20,20,0,0" Style="{DynamicResource Title}"  Text="Set Fees Structure" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,120,0,0" Style="{DynamicResource Title0}" Text="New Entry" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="88,72,0,0" TextWrapping="Wrap" Text="Class" VerticalAlignment="Top"/>
        <ComboBox HorizontalAlignment="Left" Height="23" Margin="120,72,0,0" Text="TextBox" VerticalAlignment="Top" Width="150"
                  ItemsSource="{Binding AllClasses}" DisplayMemberPath="NameOfClass" SelectedValuePath="ClassID"
                  SelectedValue="{Binding CurrentClassID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock HorizontalAlignment="Left" Margin="39,163,0,0" TextWrapping="Wrap" Text="Name of Entry" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Left" Height="23" Margin="120,163,0,0" VerticalAlignment="Top" Width="200"
                 DataContext="{Binding NewEntry}"
                 Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock HorizontalAlignment="Left" Margin="42,208,0,0" TextWrapping="Wrap" Text="Amount (KES)" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Left" Height="23" Margin="120,208,0,0" VerticalAlignment="Top" Width="150"
                 DataContext="{Binding NewEntry}"
                 Text="{Binding Amount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <Button Content="Add Entry" HorizontalAlignment="Left" Margin="215,248,0,0" VerticalAlignment="Top" Width="105"
                Command="{Binding AddEntryCommand}"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,315,0,0" Style="{DynamicResource Title0}" Text="Current Entry" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="39,362,0,0" TextWrapping="Wrap" Text="Name of Entry" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Left" Height="23" Margin="120,362,0,0" VerticalAlignment="Top" Width="200"
                 Text="{Binding SelectedItem.Name, ElementName=lbxEntries, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock HorizontalAlignment="Left" Margin="42,407,0,0" TextWrapping="Wrap" Text="Amount (KES)" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Left" Height="23" Margin="120,407,0,0" VerticalAlignment="Top" Width="150"
                 Text="{Binding SelectedItem.Amount, ElementName=lbxEntries, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock HorizontalAlignment="Left" Margin="350,80,0,0" Style="{DynamicResource Title0}" Text="Preview" VerticalAlignment="Top"/>
        <ListBox Name="lbxEntries" Margin="350,109,30,50" ItemsSource="{Binding CurrentStructure.Entries}"
                 ItemTemplate="{StaticResource FeesStructureEntryModel}"/>
        <Button Content="_Save" Margin="0,0,10,10" HorizontalAlignment="Right" Width="75" Height="26" VerticalAlignment="Bottom"
                Command="{Binding SaveCommand}"/>




    </Grid>
</UserControl>
